package com.microservices.yucloud.appweb.disruptor;

import com.lmax.disruptor.ExceptionHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zy
 * @date 2019-09-05 20:25
 **/
@Slf4j
public class OrderEventHandlerException implements ExceptionHandler<OrderEvent> {

    @Override
    public void handleEventException(Throwable throwable, long sequence, OrderEvent orderEvent) {
        throwable.fillInStackTrace();
        log.error("process data error sequence ==[{}] event==[{}] ,ex ==[{}]", sequence, orderEvent.toString(), throwable.getMessage());
    }

    @Override
    public void handleOnStartException(Throwable throwable) {
        log.error("start disruptor error ==[{}]!", throwable.getMessage());
    }

    @Override
    public void handleOnShutdownException(Throwable throwable) {
        log.error("shutdown disruptor error ==[{}]!", throwable.getMessage());
    }

}
